import AsyncStorage from '@react-native-async-storage/async-storage';
class StorageServer{
	static async saveData(key,value){
		try {
			const jsonValue = JSON.stringify(value);
			return await AsyncStorage.setItem(key, jsonValue);
		} catch (error) {
			// Error saving data
		}
	}
	static async getData(key){
		try {
			return await AsyncStorage.getItem(key);
		} catch (error) {
			// Error saving data
		}
	}
	static async clearData(key){
		try {
			return await AsyncStorage.removeItem(key);
		} catch (error) {
			// Error saving data
		}
	}
	static async clearAllData(){
		try {
			return await AsyncStorage.clear();
		} catch (error) {
			// Error saving data
		}
	}
}
export default StorageServer;
